<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.fireflysource.com/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.fireflysource.com/beans http://www.fireflysource.com/beans.xsd">

    <component-scan base-package="{{packageName}}.server.dao"/>
    <component-scan base-package="{{packageName}}.server.service"/>
    <component-scan base-package="{{packageName}}.server.router"/>

    <bean id="httpCoroutineLocal" class="com.firefly.kotlin.ext.common.CoroutineLocal"/>

    <bean id="tcpConfig" class="com.firefly.net.Config">
        <property name="timeout" value="120000"/>
    </bean>
    <bean id="ktHttpServerConfig" class="com.firefly.server.http2.SimpleHTTPServerConfiguration">
        <property name="tcpConfiguration" ref="tcpConfig"/>
    </bean>
    <bean id="ktHttpServerBodyConfig" class="com.firefly.server.http2.router.handler.body.HTTPBodyConfiguration">
        <property name="maxRequestSize" value="268435456"/>
        <property name="maxFileSize" value="268435456"/>
    </bean>

    <bean id="ktHttpServer" class="com.firefly.kotlin.ext.http.HttpServer">
        <constructor>
            <argument type="com.firefly.kotlin.ext.common.CoroutineLocal" ref="httpCoroutineLocal"/>
            <argument type="com.firefly.server.http2.SimpleHTTPServerConfiguration" ref="ktHttpServerConfig"/>
            <argument type="com.firefly.server.http2.router.handler.body.HTTPBodyConfiguration"
                      ref="ktHttpServerBodyConfig"/>
        </constructor>
    </bean>

    <bean id="serverConfig" class="{{packageName}}.server.config.ServerConfig">
        <property name="port" value="${web.server.port}"/>
        <property name="host" value="${web.server.host}"/>
        <property name="env" value="${web.server.env}"/>
        <property name="staticResourceRoot" value="${web.server.static.resource.root}"/>
        <property name="cacheVersion" value="1"/>
    </bean>

    <bean id="ktWebSeedAppMain" class="{{packageName}}.server.KtWebSeedAppMain"/>
</beans>